#include "stdafx.h"
#include "CppUnitTest.h"

#include "System/Base/Enumerator.h"
#include "System/Utility/Testing.h"

using namespace Microsoft::VisualStudio::CppUnitTestFramework;
using namespace Native::System;
using namespace Native { namespace System::Utility;

namespace TestNativeSystem
{
    TEST_CLASS(Enumerator_Tester)
    {
    public:
        enum ETest
        {
            TEST_0 = 0,
            TEST_1,
            TEST_2
        };

        Enumerator<ETest> _base;

        Enumerator_Tester()
        {
            _base.Value(TEST_0);
        }

        TEST_METHOD(Enumerator_EqualTo)
        {
            Enumerator<ETest> contrast(TEST_1);

            UEquivalentTester::CheckByEqualTo<Enumerator<ETest>>(
                dynamic_cast<IEqualTo<Enumerator<ETest>>*>(&_base),
                Enumerator<ETest>(TEST_1),
                false);
        }

        TEST_METHOD(Enumerator_Construct)
        {
            UConstructorTester::CheckByEqualTo<Enumerator<ETest>>(_base);
        }

        TEST_METHOD(Enumerator_ConstructedBySpecified)
        {
            Enumerator<ETest> test(TEST_2);

            Assert::IsTrue(test.Value() == TEST_2);
        }

        TEST_METHOD(Enumerator_ConvertToString)
        {
            Enumerator<ETest> enumerator(TEST_0);

            Assert::AreEqual(enumerator.ToString(), wstring(L"0"));
        }
    };
}
